import request from "@/utils/request";
// 获取勋章列表
export function getMedalList(pageNum, pageSize, medalName, userId) {
  return request({
    url: `/manager/medal/list?pageNum=${pageNum}&pageSize=${pageSize}&medalName=${medalName}&userId=${userId}`,
    method: "get",
  });
}
// 获取勋章详情
export function getMedalMsg(medalId) {
  return request({
    url: `/manager/medal/${medalId}`,
    method: "get",
  });
}
// 新增勋章
export function addMedal(data) {
  return request({
    url: `manager/medal`,
    method: "post",
    data: data,
  });
}
// 修改勋章

export function updateMedal(data) {
  return request({
    url: `manager/medal`,
    method: "put",
    data: data,
  });
}
// 删除勋章
export function deleteMedal(medalId) {
  return request({
    url: `/manager/medal/${medalId}`,
    method: "delete",
  });
}
// 勋章发放详情
export function getMedalStaffList(
  medalId,
  pageNum,
  pageSize,
  nickName,
  schoolId,
  postId,
  phoneNumber
) {
  return request({
    url: `/manager/medal/medalUserList/${medalId}?pageNum=${pageNum}&pageSize=${pageSize}&nickName=${nickName}&schoolId=${schoolId}&postId=${postId}&phoneNumber=${phoneNumber}`,
    method: "get",
  });
}
// 获取门店岗位树状结构
export function getSendstaffList(data) {
  return request({
    url: `/manager/medal/userList`,
    method: "get",
    params: data,
  });
}
// 查询已获得勋章员工

export function getmedalstaffList(medalId) {
  return request({
    url: `manager/medal/getMedalUserList/${medalId}`,
    method: "get",
  });
}
// 发放勋章
export function sendMedal(medalId, data) {
  return request({
    url: `manager/medal/sendMedal/${medalId}`,
    method: "post",
    data,
  });
}
